:lipstick: Cleaning up the code

Also prepare for replacing within selection functionality