Renaming and simplifying of core algorithm