find_by_prefix method implemented, code cleanup