Cleaned back-end code