Got rid of hacky code